#ifndef _HLSS_H_
#define _HLSS_H_
#include "Graph.h"

class hlss {
public:
    int **tcm, **tcm_orig;
    int *row_ones, *row_ones_orig; //count the number of 1 for each row; 
    int *col_ones, *col_ones_orig; //count the number of 1 for each column
    char *R_max, *C_max, *R, *C;
    float den_max,den;
    int cnt;
    map<int, set<int> > Lin, Lout;
	vector<vector<int> > Lin_vec, Lout_vec;
	vector<int> one_exception_vec_first, zero_exception_vec_first, one_exception_vec_second, zero_exception_vec_second;
    int node_count;
    set<pair<int, int> > zero_exception_set, one_exception_set;
    Graph gra, tc;
    int R_sz, C_sz, R_max_sz, C_max_sz;
    set<int> delete_row_set, delete_col_set;
public:
	int create_label();
    void findDSM();
    float calc_den();
    int N1();
    void update_R_C_max();
    void update_label();
    int find_min_row();
    int find_min_col();
    int N1_r(int r);
    int N1_c(int c);
    void remove_DSM();
    void print_DSM();
    void print_tcm();
    int label_size();
    void print_label();
    bool query(int u, int v);
    int batch_query(int size);
    void collect_zero_exception();
    void collect_one_exception();
    void calc_tcm();
    void copy_tcm(bool **matrix);
	void set_2_vector();
	void remove_zero();
    hlss(Graph& g, int size, bool **matrix);
    ~hlss();
};
#endif
